<option> element

The <option> element specifies a particular choice within a <select> element.


IMPORTANT     The <option> element has been extended) to allow an image in the <option> text flow. For example: 

Syntax

where content represents the text the device will display to represent the particular selection item and the action to perform if the user selects it:
 
event You can optionally specify the following element in your item definition: 
<onevent>  (see <onevent> element
text The device displays this text to represent the selection item. 

Attributes

 
title A label that identifies the option. The UP.Browser uses the title as the ACCEPT key label when the user selects the option. To ensure compatibility on a wide range of devices, label should be a maximum of five characters. 
value Specifies the value to assign to the variable defined in the <select> element name attribute if the user selects the option (see example). If you specify a variable reference, the device evaluates the reference before setting the name variable. 
onpick Specifies the URL to open if the user selects the option (or deselects it if the <select> element allows multiple choices). This attribute represents an abbreviated form of the <onevent> element. 

 

Example

In the following example, selecting an item sets the variable color to the value associated with that item (i.e. 1, 2, 3, or 4).